<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:mo="https://gitee.com/aun/Timo">
<head th:replace="/common/template :: header(~{::title},~{::link},~{::style})">
    <link rel="stylesheet" th:href="@{/lib/zTree_v3/css/zTreeStyle/zTreeStyle.css}" type="text/css">
</head>
<body class="timo-layout-page">
    <div class="layui-card">
        <div class="layui-card-header timo-card-header">
            <span><i class="fa fa-bars"></i> 积分管理</span>
            <i class="layui-icon layui-icon-refresh refresh-btn"></i>
            <a th:href="@{/mains/points/export}"><i class="fa fa-download"></i></a>
        </div>
        <div class="layui-card-body">
            <div class="layui-row timo-card-screen put-row">
                <div class="pull-left layui-form-pane timo-search-box">
                    <div class="layui-inline">
                        <label class="layui-form-label">用户昵称</label>
                        <div class="layui-input-block">
                            <input type="text" name="nickName" th:value="${nickName}" placeholder="请输入用户昵称" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <button class="layui-btn timo-search-btn">
                            <i class="fa fa-search"></i>
                        </button>
                    </div>
                </div>
            </div>
            <div class="timo-table-wrap">
                <table class="layui-table timo-table">
                    <thead>
                    <tr>
                        <th>编号</th>
                        <th>昵称</th>
                        <th>头像</th>
                        <th>积分</th>
                        <th>已使用积分</th>
                        <th>备注</th>
                        <th>创建时间</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr th:each="item:${list}">
                        <td th:text="${item.id}"></td>
                        <td th:text="${item.nickName}"></td>
                        <td>
                            <a class="open-popup"  style="cursor: pointer" th:attr="data-url=@{${item.avatar}}" data-size="600,570" href="#">预览</a>
                        </td>
                        <td th:text="${item.points}"></td>
                        <td th:text="${item.hadPoints}"></td>
                        <td th:text="${item.remark}"></td>
                        <td th:text="${#dates.format(item.createTime, 'yyyy-MM-dd HH:mm:ss')}">创建时间</td>
                        <td th:text="${item.status}"></td>
                        <td>
                            <a class="open-popup" data-title="详细信息" th:attr="data-url=@{'/mains/points/detail/'+${item.userId}}"  data-size="800,600" href="#">详细</a>
                            <a class="ajax-get" th:if="${item.states==1}" th:attr="data-msg='您是否要解冻该用户'+${item.nickName}" th:href="@{'/mains/points/status/0/'+${item.id}}">解冻积分账户</a>
                            <a class="ajax-get" th:if="${item.states==0}" th:attr="data-msg='您是否要冻结该用户'+${item.nickName}" th:href="@{'/mains/points/status/1/'+${item.id}}">冻结积分账户</a>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div th:replace="/common/fragmentSelf :: page"></div>
        </div>
    </div>
<script th:replace="/common/template :: script"></script>
<script type="text/javascript" th:src="@{/js/plugins/jquery-3.3.1.min.js}"></script>
<script type="text/javascript" th:src="@{/lib/zTree_v3/js/jquery.ztree.core.min.js}"></script>
<script type="text/javascript" th:src="@{/js/timoTree.js}"></script>
<script type="text/javascript">
    var local = window.localStorage;
    // 树形菜单
    $.fn.selectTree({
        rootTree: '全部',
        onSelected: function(treeNode){
            local.setItem('deptTitle', treeNode.name);
        }
    });
</script>
</body>
</html>